package com.geek.video.web.controller;

import com.geek.video.service.AdminService;
import com.geek.video.web.response.ResponseData;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import reactor.core.publisher.Mono;


/**
 * 管理员表(Admin)表控制层
 *
 * @author qinxh
 * @since 2021-01-25 16:33:34
 */
@RestController
@RequestMapping("admin/")
public class AdminController {
    /**
     * 服务对象
     */
    @Autowired
    private AdminService adminService;

    /**
     * 通过主键查询单条数据
     *
     * @param id 主键
     * @return 单条数据
     */
    @GetMapping("{id}/")
    public Mono<ResponseData> selectOne(@PathVariable("id") Integer id) {

        return ResponseData.ofSuccess(this.adminService.queryById(id));
    }

}